import Mock from "mockjs";
import list from "../uni_modules/uview-ui/libs/config/props/list";
const Random = Mock.Random

s
// 根据url获取query参数
const getQuery = (url, name) => {
    // console.log(url); //  /api/get/news?pageindex=1&pagesize=10
    const index = url.indexOf('?')
    // console.log(index); //13
    if (index !== -1) {
        const queryStrArr = url.substr(index + 1).split('&')
        // console.log(queryStrArr); //['pageindex=1', 'pagesize=10']
        //0: "pageindex=1"
        //1: "pagesize=10"
        for (var i = 0; i < queryStrArr.length; i++) {
            const itemArr = queryStrArr[i].split('=')
            // console.log(itemArr) //['pageindex', '1']    //['pagesize', '10']
            //0: "pageindex"        //0: "pagesize"
            //1: "1"                //1: "10"
            if (itemArr[0] === name) {
                return itemArr[1]
            }
        }
    }
    return null
}


const getDataHome = (param) => {
    return {
        code: 200,
        msg: 'success',
        data: {
            'keyword': 'AI帮你吵架...', // 中文名称
            'noticeText': '通知...通知...通知...通知...通知...通知...通知...通知...',
            'swiperImgs': [
                'https://cdn.uviewui.com/uview/swiper/swiper1.png',
                'https://cdn.uviewui.com/uview/swiper/swiper1.png',
                'https://cdn.uviewui.com/uview/swiper/swiper1.png',
                'https://cdn.uviewui.com/uview/swiper/swiper1.png'
            ],
            'new_list': [{
                name: 'photo',
                desc: '锁舒服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'photo',
                desc: '锁舒服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'photo',
                desc: '锁舒服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'photo',
                desc: '锁舒服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'photo',
                desc: '锁舒服sfsfsfsfsfsfsfs舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }],
            'hot_list': [{
                name: 'photo',
                desc: '锁舒服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'photo',
                desc: '锁舒服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'photo',
                desc: '锁舒服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'photo',
                desc: '锁舒服sfsfsfsfsfsfsfs舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'phofsfsfsfsfsfsto',
                desc: '锁舒服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'phosfsfsto',
                desc: '锁舒服sfsfsfsfsfsf舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'photo',
                desc: '锁舒服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'phofsfsfto',
                desc: '锁舒sfsfsf服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, ],
            'tj_list': [{
                name: 'photo',
                desc: '锁舒服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'photo',
                desc: '锁舒服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'photo',
                desc: '锁舒服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'photo',
                desc: '锁舒服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'photo',
                desc: '锁舒服sfsfsfsfsfsfsfs舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'phofsfsfsfsfsfsto',
                desc: '锁舒服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'phosfsfsto',
                desc: '锁舒服sfsfsfsfsfsf舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'photo',
                desc: '锁舒服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, {
                name: 'phofsfsfto',
                desc: '锁舒sfsfsf服舒服',
                img: 'https://cdn.uviewui.com/uview/album/1.jpg'
            }, ]
        }
    }
}


Mock.mock('http://localhost:3000/getDataHome', 'get', getDataHome())



	
	

